
export default {
  methods: {
    deleteUser(userId) {
      this.$dialog.confirm({ message: `确定要删除改角色吗，角色删除后不可恢复？` }).then(() => {
        this.$axios.delete(`/api/roleController/deleteRole`, { 
          userId
        }).then(() => {
          this.list = this.list.filter(item => item.userId != userId);
        });
      });
    },
    reStart(userId) {
      this.$dialog.confirm({ message: `确定要将该角色恢复正常吗？` }).then(() => {
        this.$axios.put(`/api/roleController/recoveryRole`, { 
          query: { userId }
        }).then(() => {
          this.list = this.list.filter(item => item.userId != userId);
        });
      });
    }
  }
};